<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="format-detection" content="telephone=no">
  <meta itemprop="name" content="谁说人算不如天算？快来和我一起预测押题疯狂提分！" />
  <meta itemprop="image" content="/img/ygshare.jp" />
  <meta name="description" itemprop="description" content="《高考命题预测与题——2018临考押题卷》首发预售，火热上线！" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>2018临考押题卷</title>
  <link rel="stylesheet" href="/css/reset.css">
  <link rel="stylesheet" href="/css/normalize.css">
  <link rel="stylesheet" href="/css/yg/userInfo.css">
  <% include ../component/_common_tongji.html %>
    <script>
      var scale = 1 / devicePixelRatio;
      document.querySelector('meta[name="viewport"]').setAttribute('content', 'width=device-width, initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
      document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
    </script>
    <style>
      [v-cloak] {
        display: none;
      }

      html {
        font-size: 100px;
      }

      .bg {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
      }

      .bg .modal {
        background: #FFF;
        width: 6rem;
        height: 2rem;
        line-height: 0.6rem;
        padding: 0.4rem 0;
        font-size: 0.46rem;
        text-align: center;
        margin: 0 auto;
        margin-top: 2rem;
        box-sizing: border-box;
      }
      #show {
        display: none;
      }
    </style>
    <script>     
      window.onload = function () {
        var compa = document.querySelector('#show');
        if (compa) {
          compa.style.display = 'block';
        }
      }
    </script>
</head>

<body>
  <div id="app">
    <div v-if="false" style="font-size:0.3rem;" id="show">您的浏览器版本太低请升级浏览器或者使用Chrome浏览器</div>
    <div id="content" v-cloak>
      <div class="hone_page" v-if="!shareImgSrc">
        <% include ../userInfo/top_user.html %>
        <% include ../userInfo/main.html %>       
        <% include ../userInfo/footer.html %>
      </div>
      <% include ../userInfo/shareImg.html %>
    </div>
  </div>
  <!-- 分享图片 -->
  <script src="https://sfile.tl100.com/js/libs/vue.min.js"></script>
  <script src="https://sfile.tl100.com/js/libs/axios.min.js"></script>
  <script src="/js/api.js"></script>
  <script src="/js/wx.js"></script>
  <script src="/js/getuserinfo.js"></script>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  <script>
    var app = new Vue({
      el: '#app',
      data: {
        smsText: '发送',
        token: '',
        img: '/img/9_02.png',
        queryInfo: {
          phone: '',
          sms: ''
        },
        userInfo: {
          realname: '',
          subjects: '',
          receiving_phone: '',
          city_name: '',
          cashback: '',
          invitation_count: '',
          exam_name: '',
          pay_type: "",
          receiving_address: '',
          way_bill_num: '',
          create_time: '',
          update_time: '',
          way_bill_company: '',
          options: {
            name: '',
            subject: '',
          },
          order_id: '',
          pay_tyep_wzq: '',
          price: ''
        },
        from: '',
        imgSrc: '',
        smsSending: false,
        shareImgSrc: false
      },
      mounted() {
        this.token = localStorage.getItem("token");
        if (this.token && this.token != '') {
          this.handleQuery();
          // 获取图片
          var vm = this;
          api.post('/api/user/getPreBuyShareImage', {
            token: this.token
          }).then(function (res) {
            var date = new Date();
            var time = date.getTime();
            vm.imgSrc = res.data.msg + '?' + time;

            wxObj({
              shareUrl: 'https://m.tl100.com/yg',
              title: '谁说人算不如天算？快来和我一起预测押题疯狂提分！',
              desc: '《高考命题预测与题——2018临考押题卷》首发预售，火热上线！',
              link: '?',
              imgUrl: 'img/ygshare.jpg'
            });
          });
        } else {
          location.href = '/yg/signup';
        }
      },
      methods: {
        handleShare() {
          document.querySelector('.shareImg').style.display = 'block';
          document.querySelector('.hone_page').style.display = 'none';
        },
        handleQuery: function () {
          if (this.token && this.token != '') {
            var vm = this;
            var token = localStorage.getItem("token");
            getUserInfo(this,token,'/api/pre_buy_book/getUserPreBuy',function (res_data) {
              var res = res_data;
              if (res.data.msg.state && res.data.msg.state > 0) {
                  vm.userInfo.realname = res.data.msg.receiving_name;
                  vm.userInfo.city_name = res.data.msg.city_name;
                  vm.userInfo.cashback = res.data.msg.cashback;
                  vm.userInfo.invitation_count = res.data.msg.invitation_count;
                  vm.userInfo.receiving_phone = res.data.msg.receiving_phone;
                  vm.userInfo.order_id = res.data.msg.order_id;
                  vm.userInfo.receiving_address = res.data.msg.receiving_address;
                  vm.userInfo.way_bill_num = res.data.msg.way_bill_num;
                  vm.userInfo.way_bill_company = res.data.msg.way_bill_company;
                  vm.userInfo.create_time = res.data.msg.create_time;
                  vm.userInfo.price = res.data.msg.price;
                  vm.userInfo.options.name = JSON.parse(res.data.msg.options).name;
                  vm.userInfo.options.subject = JSON.parse(res.data.msg.options).subject;
                  if (res.data.msg.pay_type == 1) {
                    vm.userInfo.pay_tyep_wzq = '微信'
                  } else if (res.data.msg.pay_type == 2) {
                    vm.userInfo.pay_tyep_wzq = '支付宝'
                  } else if (res.data.msg.pay_type == 3) {
                    vm.userInfo.pay_tyep_wzq = 'qq'
                  }
                } else {
                  alert('您还未购买，请先购买');
                  location.replace('/yg/signup');
                }
            });
          } else {
            alert('请先登录');
            location.replace('/yg/signup');
          }
        },
        handleshareLink: function () {
          this.shareImgSrc = true;
          console.log('1');
          // 点击显示图片
          clearTimeout(timer);
          var timer = setTimeout(function () {
            document.getElementsByClassName('bg')[0].style.display = 'none';
          }, 3500);
        },
        handleToggle: function () {
          localStorage.removeItem('token');
          location.replace('/yg/signup');
        }
      }
    })
  </script>
</body>

</html>